<?php
declare(strict_types=1);
// 优惠券
namespace app\tjy_v1\controller;
class Coupon
{
    // 领券中心优惠券列表
    public function List()
    {
        $apidb = [
            'code' => 200,
            'time' => time(),
            'cache' => cache("我是谁"),
            'msg' => "领券中心优惠券列表",
            "db"=>[
                "total"=>2,
                "list"=>[
                    [
                        "id"=>1,
                        "coupon_id"=>"153902814624227330",
                        "coupon_type"=>1,
                        "coupon_name"=>"新年专享",
                        "coupon_total"=>999999,
                        "coupon_desc"=>"",
                        "minimum"=>99,
                        "discount"=>30,
                        "use_scope"=>1,
                        "effective_type"=>1,
                        "effective_start_time"=>"2021-03-13 ",
                        "effective_end_time"=>"2021-05-01 ",
                        "effective_days"=>0,
                        "quota"=>999999,
                        "distribution_method"=>1,
                        "release_start_time"=>"2021-03-01 00:00:00",
                        "release_end_time"=>"2024-05-31 00:00:00",
                        "status"=>1,
                        "is_delete"=>0,
                        "update_time"=>"2021-02-28 16:34:50",
                        "create_time"=>"2021-02-28 16:34:50",
                        "is_received"=>0,
                        "use_scope_text"=>"全部商品可用"
                    ],
                    [
                        "id"=>2,
                        "coupon_id"=>"153902814624227340",
                        "coupon_type"=>1,
                        "coupon_name"=>"新年专享",
                        "coupon_total"=>999999,
                        "coupon_desc"=>"",
                        "minimum"=>99,
                        "discount"=>30,
                        "use_scope"=>1,
                        "effective_type"=>1,
                        "effective_start_time"=>"2021-03-13 ",
                        "effective_end_time"=>"2021-05-01 ",
                        "effective_days"=>0,
                        "quota"=>999999,
                        "distribution_method"=>1,
                        "release_start_time"=>"2021-03-01 00:00:00",
                        "release_end_time"=>"2024-05-31 00:00:00",
                        "status"=>1,
                        "is_delete"=>0,
                        "update_time"=>"2021-02-28 16:34:50",
                        "create_time"=>"2021-02-28 16:34:50",
                        "is_received"=>0,
                        "use_scope_text"=>"全部商品可用"
                    ]
                ],
            ]
        ];
        return json($apidb);
    }
        // 我的优惠券
        public function MYList()
        {
            $apidb = [
                'code' => 200,
                'time' => time(),
                'cache' => cache("我是谁"),
                'msg' => "我的优惠券",
                "db"=>[
                    "total"=>2,
                    "list"=>[
                        [
                            "coupon_name"=>"新年专享",
                            "discount"=>30,
                            "minimum"=>99,
                            "coupon_desc"=>"",
                            "use_scope"=>1,
                            "effective_start_time"=>"2021-03-13 ",
                            "effective_end_time"=>"2021-05-01 ",
                            "status"=>3,
                            "order_sn"=>"",
                            "create_time"=>"2021-05-08 22:27:56",
                            "use_time"=>"0000-00-00 00:00:00",
                            "coupon_id"=>"153902814624227330",
                            "user_coupon_id"=>"178996438662369282",
                            "use_scope_text"=>"全部商品可用",
                            "is_used"=>0,
                            "is_expired"=>1
                        ],
                        [
                            "coupon_name"=>"新年专享",
                            "discount"=>30,
                            "minimum"=>99,
                            "coupon_desc"=>"",
                            "use_scope"=>1,
                            "effective_start_time"=>"2021-03-13 ",
                            "effective_end_time"=>"2021-05-01 ",
                            "status"=>3,
                            "order_sn"=>"",
                            "create_time"=>"2021-07-29 23:08:42",
                            "use_time"=>"0000-00-00 00:00:00",
                            "coupon_id"=>"153902814624227330",
                            "user_coupon_id"=>"208722503146352642",
                            "use_scope_text"=>"全部商品可用",
                            "is_used"=>0,
                            "is_expired"=>1
                        ]
                    ]
                ]
            ];
            return json($apidb);
        }
             // 我的不可用优惠券
             public function MYNotAvailable()
             {
                 $apidb = [
                     'code' => 200,
                     'time' => time(),
                     'cache' => cache("我是谁"),
                     'msg' => "我的不可用优惠券",
                     "db"=>[
                         "total"=>2,
                         "list"=>[
                             [
                                 "coupon_name"=>"新年专享",
                                 "discount"=>30,
                                 "minimum"=>99,
                                 "coupon_desc"=>"",
                                 "use_scope"=>1,
                                 "effective_start_time"=>"2021-03-13 ",
                                 "effective_end_time"=>"2021-05-01 ",
                                 "status"=>3,
                                 "order_sn"=>"",
                                 "create_time"=>"2021-05-08 22:27:56",
                                 "use_time"=>"0000-00-00 00:00:00",
                                 "coupon_id"=>"153902sf7330",
                                 "user_coupon_id"=>"178996438662369282",
                                 "use_scope_text"=>"全部商品可用",
                                 "is_used"=>0,
                                 "is_expired"=>1
                             ],
                             [
                                 "coupon_name"=>"新年专享",
                                 "discount"=>30,
                                 "minimum"=>99,
                                 "coupon_desc"=>"",
                                 "use_scope"=>1,
                                 "effective_start_time"=>"2021-03-13 ",
                                 "effective_end_time"=>"2021-05-01 ",
                                 "status"=>3,
                                 "order_sn"=>"",
                                 "create_time"=>"2021-07-29 23:08:42",
                                 "use_time"=>"0000-00-00 00:00:00",
                                 "coupon_id"=>"153902814624227330",
                                 "user_coupon_id"=>"208722503146352642",
                                 "use_scope_text"=>"全部商品可用",
                                 "is_used"=>0,
                                 "is_expired"=>1
                             ]
                         ]
                     ]
                 ];
                 return json($apidb);
             }
        // 优惠券领取
        public function receive()
        {
            $apidb = [
                'code' => 200,
                'time' => time(),
                'cache' => cache("我是谁"),
                'msg' => "优惠券领取-成功",
            ];
            return json($apidb);
        }
         // 优惠券使用
         public function use()
         {
             $apidb = [
                 'code' => 200,
                 'time' => time(),
                 'cache' => cache("我是谁"),
                 'msg' => "优惠券使用-成功",
             ];
             return json($apidb);
         }
}
